import store from '../store';
const notOpened = [ //未开放的页面
	'/pages/home/facileService/facileService'
]
/**
 * 页面跳转
 */
const goToUrl = (_url, notoken) => {
	if (notoken) {
		uni.navigateTo({
			url: _url
		})
		return
	}

	if (!uni.getStorageSync('token')) {
		uni.navigateTo({
			url: '/pages/login/login/login'
		})
	} else {

		for (let i in notOpened) {
			if (notOpened[i] == _url) {
				uni.showToast({
					title: '功能未开放',
					icon: 'none',
					duration: 2000
				});
				return;
			}
		}
		uni.navigateTo({
			url: _url
		})
	}
}
export default goToUrl
